﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;

namespace Conqueror.WP.ViewModel
{
    public class QuickActionViewModel : ViewModel
    {
        private string name;
        private SolidColorBrush background;
        private string image = @"/Image/Icons/appbar.globe.png";
        private int index;
        private int expandedIndex;
        private bool expanded = false;

        public string Name { get { return name; }
            set
            {
                if (name != value)
                {
                    name = value;
                    Notify("Name");
                }
            }
        }

        public SolidColorBrush Background
        {
            get { return background; }
            set
            {
                if (background != value)
                {
                    background = value;
                    Notify("Background");
                }
            }
        }

        public string Image
        {
            get { return image; }
            set
            {
                if (image != value)
                {
                    image = value;
                    Notify("Image");
                }
            }
        }

        public int Index { get { return index; } }
        public int ExpandedIndex { get { return expandedIndex; } }

        public event EventHandler<bool> Expanded;

        public bool IsExpanded
        {
            get { return expanded; }
            set
            {
                if (expanded != value)
                {
                    expanded = value;
                    Notify("IsExpanded");
                    if (Expanded != null)
                        Expanded(this, expanded);
                }
            }
        }

        public QuickActionViewModel(int index)
        {
            this.index = index;
            this.expandedIndex = (index / 6) * 6;
        }
    }
}
